<?php
use common\components\GlobalUrlComponent;
use yii\helpers\Url;
use common\models\Admin\Admin;
$controller = Yii::$app->controller;
?>
<!-- Left navbar-header -->
<div class="navbar-default sidebar" role="navigation">
    <div class="sidebar-nav navbar-collapse slimscrollsidebar">
    <ul class="nav" id="side-menu">
        <li class="sidebar-search hidden-sm hidden-md hidden-lg">
            <!-- input-group -->
            <div class="input-group custom-search-form">
                <input type="text" class="form-control" placeholder="Search..."> <span class="input-group-btn">
            <button class="btn btn-default" type="button"> <i class="fa fa-search"></i> </button>
            </span> </div>
            <!-- /input-group -->
        </li>
        <li class="user-pro">
            <a href="<?=Url::to(["/"])?>" class="waves-effect"><span class="hide-menu"> 首页<span class="fa arrow"></span></span>
            </a>
            <!--ul class="nav nav-second-level">
                <li><a href="javascript:void(0)"><i class="ti-user"></i> My Profile</a></li>
                <li><a href="javascript:void(0)"><i class="ti-wallet"></i> My Balance</a></li>
                <li><a href="javascript:void(0)"><i class="ti-email"></i> Inbox</a></li>
                <li><a href="javascript:void(0)"><i class="ti-settings"></i> Account Setting</a></li>
                <li><a href="javascript:void(0)"><i class="fa fa-power-off"></i> Logout</a></li>
            </ul-->
        </li>
        <?php if (Admin::isTopAgentCurrent() || Admin::isAdminCurrent() || Admin::isRegionManagerCurrent()) : ?>
            <li <?php if (in_array($controller->id, ['agent', "region-manager"]) ) : ?>class="active" <?php endif ?> >
                <a href="javascript:void(0)" class="waves-effect">
                    <i data-icon="`" class="linea-icon linea-basic fa-fw"></i>
                    <span class="hide-menu">
                    账号 管理
                    <span class="fa arrow"></span>
                </span>
                </a>
                <ul class="nav nav-second-level">
                    <li>
                        <a href="<?=Url::to(['/agent'])?>" class="waves-effect">
                            代理商
                        </a>
                        <?php if (Admin::isAdminCurrent()) : ?>
                            <a href="<?=Url::to(['/region-manager'])?>" class="waves-effect">
                                区域经理
                            </a>
                        <?php endif ?>
                    </li>
                </ul>
            </li>
        <?php endif ?>

        <li <?php if (in_array($controller->id, ['report']) ) : ?>class="active" <?php endif ?> >
            <a href="javascript:void(0)" class="waves-effect">
                <i data-icon="`" class="linea-icon linea-basic fa-fw"></i>
                <span class="hide-menu">
                    数据报表
                    <span class="fa arrow"></span>
                </span>
            </a>
            <ul class="nav nav-second-level">
                <li>
                    <a href="<?=Url::to(['/report/index'])?>" class="waves-effect">
                        报表数据
                    </a>

                    <a href="<?=Url::to(['/report/agent'])?>" class="waves-effect">
                        代理商月结表
                    </a>
                    <?php if (Admin::isAdminCurrent()) : ?>
                        <a href="<?=Url::to(['/percentage/index'])?>" class="waves-effect">
                            终端数分配
                        </a>

                        <a href="<?=Url::to(['/report/manager'])?>" class="waves-effect">
                            区域总经理月结表
                        </a>

                        <a href="<?=Url::to(['/plugs-run-total/analysis'])?>" class="waves-effect">
                            地区汇总表
                        </a>
                        <a href="<?=Url::to(['/report/p2p'])?>" class="waves-effect">
                            非p2p终端数
                        </a>
                    <?php endif ?>
                </li>
            </ul>
        </li>
        <?php if (Admin::isAdminCurrent()) : ?>
            <li <?php if (in_array($controller->id, ['wx-public']) ) : ?>class="active" <?php endif ?> >
                <a href="javascript:void(0)" class="waves-effect">
                    <i data-icon="`" class="linea-icon linea-basic fa-fw"></i>
                    <span class="hide-menu">
                    管理功能
                    <span class="fa arrow"></span>
                </span>
                </a>
                <ul class="nav nav-second-level">
                    <li>
                        <a href="<?=Url::to(['/wx-public'])?>" class="waves-effect">
                            公众号管理
                        </a>
                    </li>
                </ul>
            </li>
        <?php endif ?>
    </ul>
</div>
</div>
<!-- Left navbar-header end -->